package com.jxdinfo.hussar.example.ymmb.wsdexttestingreport1.controller;

import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Arrays;
import com.jxdinfo.hussar.example.ymmb.wsdexttestingreport1.dto.WsdExttestingReport1SelectCondition;
import org.springframework.beans.factory.annotation.Autowired;
import com.jxdinfo.hussar.example.ymmb.wsdexttestingreport1.vo.WsdExttestingReport1PageVO;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import com.jxdinfo.hussar.example.ymmb.wsdexttestingreport1.model.WsdExttestingReport1;
import org.springframework.web.bind.annotation.RequestBody;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import com.jxdinfo.hussar.example.ymmb.wsdexttestingreport1.service.WsdExttestingReport1Service;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 外检报告控制器
 */
@RestController(value = "ymmb.wsdexttestingreport1.WsdExttestingReport1Controller")
@AuditLog(moduleName = "外检报告")
@RequestMapping(value = "/ymmb/wsdExttestingReport1")
public class WsdExttestingReport1Controller extends HussarBaseController<WsdExttestingReport1, WsdExttestingReport1Service> {

    private static final Logger logger = LoggerFactory.getLogger(WsdExttestingReport1Controller.class);

    @Autowired
    private WsdExttestingReport1Service wsdExttestingReport1Service;

    /**
     * 外检报告表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage")
    public ApiResponse<WsdExttestingReport1PageVO> hussarQueryPage(@RequestBody Page<WsdExttestingReport1> page) {
        return wsdExttestingReport1Service.hussarQueryPage(page);
    }

    /**
     * 外检报告表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage_order_custom")
    public ApiResponse<WsdExttestingReport1PageVO> hussarQueryPage_order_custom(@RequestBody Page<WsdExttestingReport1> page) {
        return wsdExttestingReport1Service.hussarQueryPage_order_custom(page);
    }

    /**
     * 外检报告表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterPage")
    public ApiResponse<WsdExttestingReport1PageVO> ConditionFilterPage(@RequestBody WsdExttestingReport1SelectCondition wsdExttestingReport1SelectCondition) {
        return wsdExttestingReport1Service.ConditionFilterPage(wsdExttestingReport1SelectCondition);
    }

    /**
     * 外检报告表格自定义查询（带分页）
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "表格自定义查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("ConditionFilterPage_order_custom")
    public ApiResponse<WsdExttestingReport1PageVO> ConditionFilterPage_order_custom(@RequestBody WsdExttestingReport1SelectCondition wsdExttestingReport1SelectCondition) {
        return wsdExttestingReport1Service.ConditionFilterPage_order_custom(wsdExttestingReport1SelectCondition);
    }

    /**
     * 外检报告表格批量删除
     *
     * @param ids id数组
     * @return 删除成功标识
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "批量删除", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.UPDATE)
    @PostMapping("flagDelete")
    public ApiResponse<Boolean> flagDelete(@RequestParam(value = "ids") String[] ids) {
        return wsdExttestingReport1Service.flagDelete(Arrays.asList(ids));
    }

    /**
     * 外检报告新增或修改
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "新增或修改", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("insertOrUpdate")
    public ApiResponse<String> insertOrUpdate(@RequestBody WsdExttestingReport1 wsdExttestingReport1) {
        return wsdExttestingReport1Service.insertOrUpdate(wsdExttestingReport1);
    }

    /**
     * 外检报告表单查询
     */
    @AuditLog(moduleName = "外检报告", eventDesc = "表单查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @GetMapping("formQuery")
    public ApiResponse<WsdExttestingReport1> formQuery(@RequestParam(value = "id") String id) {
        return wsdExttestingReport1Service.formQuery(id);
    }
}
